import {
  clearObject,
  deepCopyObj,
  copyObjBySelf
} from '../../../assets/js/help.js'
import api from '../../../fetch/api'
export default {
  data() {
    return {

    }
  },
  created() {
    
  },
  methods: {
    getList() {
      let params = $.extend({}, this.searchParams, this.otherParams);
      this.getItemList(params);
    },
    getItemList(aparams) { //查询列表
      let _this = this,
        params = {
          page: this.pageNumber,
          rp: this.pageSize
        };
      params = $.extend({}, params, aparams);
      api.fetchGet('/mobile/report/list.do', params).then(res => {
        if (res.status == 1) {
          let data = res.data,
            list = data.rows;
          _this.tbodysInfo = !list[0] ? [] : list;
          _this.total = data.total;
        } else {
          _this.showToast(res.message, 2, 2000)
          return;
        }
      }, err => {})
    },
    exportReport () {
      let self = this;
      let theadsArr = []
      for(let i = 0; i<self.theadsInfo.length; i++){
        if(self.theadsInfo[i].checked){
          theadsArr.push(self.theadsInfo[i].prop)
        }
      }
      let params = {
        meterList: theadsArr.join(',')
      };
      params = $.extend({}, params, this.searchParams, this.otherParams);
      self.showDialog("确认导出该报表?", '', function () {
        self.toExportAsync('mobile/report/export.do', params);
      });
    },
  }
}
